﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LibNoise.Utilities {
	class Vector3 {
		public double X;
		public double Y;
		public double Z;
		public static Vector3 Zero = new Vector3(0, 0, 0);

		public Vector3() : this(0, 0, 0) {
		}

		public Vector3(double X, double Y, double Z) {
			this.X = X;
			this.Y = Y;
			this.Z = Z;
		}

		public static Vector3 operator +(Vector3 Left, Vector3 Right) {
			return new Vector3(Left.X + Right.X, Left.Y + Right.Y, Left.Z + Right.Z);
		}

		public double Length() {
			return Math.Sqrt((X * X) + (Y * Y) + (Z * Z));
		}

		public void Normalize() {
			double length = Length();
			X /= length;
			Y /= length;
			Z /= length;
		}
	}
}
